feat: Add dedicated mode for UnslothService#577
Merged
vivekkalyan merged 16 commits intomainfrom Feb 24, 2026
Merged
Conversation
51bda4d to
7c12d57
Compare
a92f9f3 to
a5cfa22
Compare
a5cfa22 to
5930142
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #578 (edit: now on main)
Summary
Adds a dedicated mode to
UnslothServicewhere training and inference run on separate GPUs. Training stays in-process on the trainer GPU(s); vLLM runs as a subprocess on the inference GPU. This eliminates the sleep/wake overhead of shared mode and enables true async overlap between training and inference.Shared mode remains the default and is unchanged. Dedicated mode is opt-in via explicit GPU ID lists in
_internal_config:Architecture
What's included
dev/model.py,dev/validate.py):trainer_gpu_idsandinference_gpu_idswith validation (non-overlapping, contiguous from 0, single inference GPU for now)vllm/dedicated_server.py): Applies ART patches, enables tool calling and runtime LoRA updates, then starts vLLMunsloth/service.py): Subprocess lifecycle (start, health check, close), adapter reload via HTTP after each train step, no sleep/wakelocal/backend.py): Detects dedicated config, setsCUDA_VISIBLE_DEVICESbefore model init, routes to dedicated modeTesting
Benchmark: ART-E to convergence with both Shared and Dedicated mode: